<!DOCTYPE html>
<html lang="en">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">















  <link rel="alternate" href="/blog/default" title="Hexo" >




  <link rel="shortcut icon" type="image/x-icon" href="/blog/favicon.ico?v=2.9.0" />



<link rel="canonical" href="https://gitee.com/LucasGitee/blog/"/>



  <link rel="stylesheet" type="text/css" href="/blog/lib/fancybox/jquery.fancybox.css" />




  <link rel="stylesheet" type="text/css" href="/blog/lib/nprogress/nprogress.min.css" />



<link rel="stylesheet" type="text/css" href="/blog/css/style.css?v=2.9.0" />



  



  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>








<script>
  window.config = {"since":2015,"favicon":"/favicon.ico","rss":"default","menu":{"Home":"/"},"color":"Default","toc":true,"fancybox":true,"pjax":true,"copyright":{"enable":true,"license":"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\">知识共享署名-非商业性使用 4.0 国际许可协议</a>"},"reward":{"enable":false,"qrCode":{"wechat":null,"alipay":null}},"social":{"email":"your@email.com","stack-overflow":null,"twitter":null,"facebook":null,"linkedin":null,"google":null,"github":"https://github.com/ahonn","weibo":null,"zhihu":null,"douban":null,"pocket":null,"tumblr":null,"instagram":null},"leancloud":{"app_id":null,"app_key":null},"baidu_analytics":null,"baidu_verification":null,"google_analytics":null,"google_verification":null,"disqus_shortname":null,"changyan":{"appid":null,"appkey":null},"livere_datauid":null,"version":"2.9.0"};
</script>

    <title> Hexo </title>
  <meta name="generator" content="Hexo 5.4.0"></head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/blog/." class="logo">Hexo</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/blog/">
        <li class="mobile-menu-item">
          
          
            Home
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/blog/." class="logo">Hexo</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/">
            
            
              Home
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  <section id="posts" class="posts">
    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/02/py-basic/">py_basic</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-02
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/02/cpp-basic/">cpp_basic</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-02
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/02/java-basic/">java_basic</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-02
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/linux-shell/">linux_shell</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/snippets/">snippets 教程</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          <h2 id="解决markdown（md）中snippet无法使用的问题"><a href="#解决markdown（md）中snippet无法使用的问题" class="headerlink" title="解决markdown（md）中snippet无法使用的问题"></a>解决markdown（md）中snippet无法使用的问题</h2><p>只是写好片段后要打开markdown的quickSuggestions选项ctrl+p打开VS的settings.json,添加 </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&quot;[markdown]&quot;:&#123;</span><br><span class="line"> &quot;editor.quickSuggestions&quot;: true</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>甚至可以直接针对文件名后缀设置，比如我使用文件名为xxx.todo，想在这个文件里快速插入当前日期片段，只需要在settings.json同样添加： </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&quot;[todo]&quot;:&#123;</span><br><span class="line"> &quot;editor.quickSuggestions&quot;: true</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="pesonal-use-snippets-global"><a href="#pesonal-use-snippets-global" class="headerlink" title="pesonal use snippets (global)"></a>pesonal use snippets (global)</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">	&#x2F;&#x2F; Place your snippets for c here. Each snippet is defined under a snippet name and has a prefix, body and </span><br><span class="line">	&#x2F;&#x2F; description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:</span><br><span class="line">	&#x2F;&#x2F; $1, $2 for tab stops, $0 for the final cursor position, and $&#123;1:label&#125;, $&#123;2:another&#125; for placeholders. Placeholders with the </span><br><span class="line">	&#x2F;&#x2F; same ids are connected.</span><br><span class="line">	&#x2F;&#x2F; Example:</span><br><span class="line">	&quot;Print to console&quot;: &#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;log&quot;,</span><br><span class="line">		&quot;body&quot;: [</span><br><span class="line">			&quot;console.log(&#39;$1&#39;);&quot;,</span><br><span class="line">			&quot;$2&quot;</span><br><span class="line">		],</span><br><span class="line">		&quot;description&quot;: &quot;Log output to console&quot;</span><br><span class="line">	&#125;,</span><br><span class="line">	&quot;define&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;def&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;#define $1&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	 &quot;todo&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;todo&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#x2F;** TODO: $1 [Lucas t:$CURRENT_YEAR&#x2F;$CURRENT_MONTH&#x2F;$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND]*&#x2F; &quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	 &quot;note&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;note&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#x2F;** NOTE: $1 [Lucas t:$CURRENT_YEAR&#x2F;$CURRENT_MONTH&#x2F;$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND]*&#x2F; &quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	&quot;&#x2F;**  *&#x2F;&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;cc1&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#x2F;** $1 *&#x2F;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	&quot;&#x2F;**&lt;  *&#x2F;&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;cc2&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#x2F;**&lt; $1 *&#x2F;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	&quot;typedef enum&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;typedef e&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;typedef enum $&#123;1:EnumName&#125; &#123;\n\t$2\n&#125;$&#123;3:EnumName&#125;;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	&quot;typedef struct&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;typedef s&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;typedef struct $&#123;1:StructName&#125; &#123;\n\t$2\n&#125;$&#123;3:StructName&#125;;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	 &quot;#ifndef … #define … #endif&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;#ifndef&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;#ifndef $&#123;1:SYMBOL&#125;\n#define $1 $&#123;2:value&#125;\n#endif\t&#x2F;&#x2F; $&#123;1:SYMBOL&#125;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	 &quot;#ifdef … #define … #endif&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;#ifdef&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;#ifndef $&#123;1:SYMBOL&#125;\n#define $1 $&#123;2:value&#125;\n#endif\t&#x2F;&#x2F; $&#123;1:SYMBOL&#125;&quot;</span><br><span class="line">	 &#125;,</span><br><span class="line">	 &quot;for loop&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;for&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;for ($&#123;1:i&#125; &#x3D; 0; $&#123;1:i&#125; &lt; $&#123;2:count&#125;; $&#123;1:i&#125;$&#123;3:++&#125;) &#123;\n\t$4\n&#125;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;Do While Loop&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;do&#123;&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;do &#123;\n\t$0\n&#125; while($1);&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;If Else&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;if&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;if ($1)\n&#123;\n\t$2\n&#125;\nelse\n&#123;\n\t$3\n&#125;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;int function&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;int &quot;,</span><br><span class="line">		&quot;body&quot;: &quot;$&#123;1:int&#125; $&#123;2:name&#125;($3) \n&#123;\n\t$5\n\treturn $&#123;4:0&#125;;\n&#125;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;do nothing&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;don&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#x2F;** do nothing *&#x2F;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;void function&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;void &quot;,</span><br><span class="line">		&quot;body&quot;: &quot;$&#123;1:void&#125; $&#123;2:name&#125;($3) \n&#123;\n\t$5\n\treturn;\n&#125;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;md code section&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;mdcd&quot;,</span><br><span class="line">		&quot;body&quot;: &quot;&#96;&#96;&#96;\n$1\n&#96;&#96;&#96;&quot;</span><br><span class="line">	  &#125;,</span><br><span class="line">	  &quot;file header&quot;:&#123;</span><br><span class="line">		&quot;prefix&quot;: &quot;funcheader&quot;,</span><br><span class="line">		&quot;body&quot;:[</span><br><span class="line">			&quot;&#x2F;**********************************************************************&#x2F;&#x2F;**&quot;,</span><br><span class="line">			&quot;@brief   $&#123;1&#125;\n&quot;,</span><br><span class="line">			&quot;@param   $&#123;2&#125; [In]  $&#123;3&#125;&quot;,</span><br><span class="line">			&quot;@param   $&#123;4&#125; [Out] $&#123;5&#125;\n&quot;,</span><br><span class="line">			&quot;@return $&#123;6&#125;\n&quot;,</span><br><span class="line">			&quot;@author Lucas&quot;,</span><br><span class="line">			&quot;@date   $CURRENT_YEAR&#x2F;$CURRENT_MONTH&#x2F;$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND&quot;,</span><br><span class="line">			&quot;@note\nHistory:&quot;,</span><br><span class="line">			&quot;**************************************************************************&#x2F;&quot;</span><br><span class="line">			],</span><br><span class="line">		&#125;,</span><br><span class="line">		&quot;funtion header&quot;:&#123;</span><br><span class="line">			&quot;prefix&quot;: &quot;fileheader&quot;,</span><br><span class="line">			&quot;body&quot;:[</span><br><span class="line">				&quot;&#x2F;**********************************************************************&#x2F;&#x2F;**&quot;,</span><br><span class="line">				&quot;\t\t\tMeteor Firmware Platform&quot;,</span><br><span class="line">				&quot;\t\t\t  $&#123;1:file comment&#125;&quot;,</span><br><span class="line">				&quot;*-&quot;,</span><br><span class="line">				&quot;@file   $TM_FILENAME&quot;,</span><br><span class="line">				&quot;@author Lucas&quot;,</span><br><span class="line">				&quot;@date   $CURRENT_YEAR&#x2F;$CURRENT_MONTH&#x2F;$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND&quot;,</span><br><span class="line">				&quot;@brief $&#123;2:brief&#125;&quot;,</span><br><span class="line">				&quot;**************************************************************************&#x2F;&quot;</span><br><span class="line">			],</span><br><span class="line">		&#125;,</span><br><span class="line"></span><br><span class="line">		&quot;py module header&quot;:&#123;</span><br><span class="line">			&quot;prefix&quot;: &quot;pyfileheader&quot;,</span><br><span class="line">			&quot;body&quot;:[</span><br><span class="line">				&quot;&#39;&#39;&#39;&quot;,</span><br><span class="line">				&quot;\t\t$&#123;1:module name&#125;&quot;,</span><br><span class="line">				&quot;&quot;,</span><br><span class="line">				&quot;file   $TM_FILENAME&quot;,</span><br><span class="line">				&quot;author Lucas&quot;,</span><br><span class="line">				&quot;date   $CURRENT_YEAR&#x2F;$CURRENT_MONTH&#x2F;$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND&quot;,</span><br><span class="line">				&quot;history:&quot;,</span><br><span class="line">				&quot;&quot;,</span><br><span class="line">				&quot;&#39;&#39;&#39;&quot;</span><br><span class="line">			],</span><br><span class="line">		&#125;,</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/gcc-usage/">gcc_usage</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/makefile/">makefile</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/GDB-debug/">GDB_debug</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/libevent/">libevent</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          <h2 id="源码安装"><a href="#源码安装" class="headerlink" title="源码安装"></a>源码安装</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br></pre></td><td class="code"><pre><span class="line"># 下载源码</span><br><span class="line">wget https:&#x2F;&#x2F;github.com&#x2F;libevent&#x2F;libevent&#x2F;releases&#x2F;download&#x2F;release-2.1.12-stable&#x2F;libevent-2.1.12-stable.tar.gz</span><br><span class="line"></span><br><span class="line"># 解压</span><br><span class="line">tar -zxvf libevent-2.1.11-stable.tar.gz </span><br><span class="line"></span><br><span class="line"># 配置安装路径</span><br><span class="line">cd libevent-2.1.11-stable</span><br><span class="line">.&#x2F;configure --prefix&#x3D;&#x2F;usr&#x2F;local&#x2F;libevent&#x2F;</span><br><span class="line"></span><br><span class="line"># 编译安装（注意权限）</span><br><span class="line">make</span><br><span class="line">make install</span><br><span class="line"></span><br><span class="line">#测试是否已经安装</span><br><span class="line">ls &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;lib</span><br><span class="line">ls &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;include</span><br><span class="line">pi@raspberrypi:~&#x2F;Downloads&#x2F;libevent-2.1.10-stable $ ls &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;lib</span><br><span class="line">libevent-2.1.so.6           libevent_core.la             libevent_extra.so               libevent_pthreads.so</span><br><span class="line">libevent-2.1.so.6.0.4       libevent_core.so             libevent.la                     libevent.so</span><br><span class="line">libevent.a                  libevent_extra-2.1.so.6      libevent_pthreads-2.1.so.6      pkgconfig</span><br><span class="line">libevent_core-2.1.so.6      libevent_extra-2.1.so.6.0.4  libevent_pthreads-2.1.so.6.0.4</span><br><span class="line">libevent_core-2.1.so.6.0.4  libevent_extra.a             libevent_pthreads.a</span><br><span class="line">libevent_core.a             libevent_extra.la            libevent_pthreads.la</span><br><span class="line">pi@raspberrypi:~&#x2F;Downloads&#x2F;libevent-2.1.10-stable $ ls &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;include</span><br><span class="line">evdns.h  event2  event.h  evhttp.h  evrpc.h  evutil.h</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">ls -al &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;lib | grep libevent</span><br><span class="line"></span><br><span class="line">    # 安装之后是如下打印</span><br><span class="line">        pi@raspberrypi:~&#x2F;Downloads&#x2F;libevent-2.1.10-stable&#x2F;sample $ ls -al &#x2F;usr&#x2F;lib | grep libevent</span><br><span class="line">        lrwxrwxrwx  1 root root      21 Apr  1 07:31 libevent-2.1.so.6 -&gt; libevent-2.1.so.6.0.4</span><br><span class="line">        -rwxr-xr-x  1 root root 1267664 Apr  1 07:31 libevent-2.1.so.6.0.4</span><br><span class="line">        -rw-r--r--  1 root root 1706940 Apr  1 07:31 libevent.a</span><br><span class="line">        lrwxrwxrwx  1 root root      26 Apr  1 07:31 libevent_core-2.1.so.6 -&gt; libevent_core-2.1.so.6.0.4</span><br><span class="line">        -rwxr-xr-x  1 root root  846504 Apr  1 07:31 libevent_core-2.1.so.6.0.4</span><br><span class="line">        -rw-r--r--  1 root root 1150530 Apr  1 07:31 libevent_core.a</span><br><span class="line">        -rwxr-xr-x  1 root root     988 Apr  1 07:31 libevent_core.la</span><br><span class="line">        lrwxrwxrwx  1 root root      26 Apr  1 07:31 libevent_core.so -&gt; libevent_core-2.1.so.6.0.4</span><br><span class="line">        lrwxrwxrwx  1 root root      27 Apr  1 07:31 libevent_extra-2.1.so.6 -&gt; libevent_extra-2.1.so.6.0.4</span><br><span class="line">        -rwxr-xr-x  1 root root  447320 Apr  1 07:31 libevent_extra-2.1.so.6.0.4</span><br><span class="line">        -rw-r--r--  1 root root  556482 Apr  1 07:31 libevent_extra.a</span><br><span class="line">        -rwxr-xr-x  1 root root     995 Apr  1 07:31 libevent_extra.la</span><br><span class="line">        lrwxrwxrwx  1 root root      27 Apr  1 07:31 libevent_extra.so -&gt; libevent_extra-2.1.so.6.0.4</span><br><span class="line">        -rwxr-xr-x  1 root root     953 Apr  1 07:31 libevent.la</span><br><span class="line">        lrwxrwxrwx  1 root root      30 Apr  1 07:31 libevent_pthreads-2.1.so.6 -&gt; libevent_pthreads-2.1.so.6.0.4</span><br><span class="line">        -rwxr-xr-x  1 root root   20792 Apr  1 07:31 libevent_pthreads-2.1.so.6.0.4</span><br><span class="line">        -rw-r--r--  1 root root   19142 Apr  1 07:31 libevent_pthreads.a</span><br><span class="line">        -rwxr-xr-x  1 root root    1016 Apr  1 07:31 libevent_pthreads.la</span><br><span class="line">        lrwxrwxrwx  1 root root      30 Apr  1 07:31 libevent_pthreads.so -&gt; libevent_pthreads-2.1.so.6.0.4</span><br><span class="line">        lrwxrwxrwx  1 root root      21 Apr  1 07:31 libevent.so -&gt; libevent-2.1.so.6.0.4</span><br><span class="line"></span><br><span class="line"># 使用样例程序进行测试</span><br><span class="line">cd sample&#x2F;</span><br><span class="line"></span><br><span class="line"># 编译 (增加编译选项)</span><br><span class="line">	gcc  demo.c -o demo -I &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;include&#x2F; -L &#x2F;usr&#x2F;local&#x2F;libevent&#x2F;lib -levent</span><br><span class="line"></span><br></pre></td></tr></table></figure>
        
      
    </div>

    

    

  </article>

    
      
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          <a class="post-link" href="/blog/2021/04/01/hexo/">hexo</a>
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        
        

        
          <h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><h2 id="编译和发布"><a href="#编译和发布" class="headerlink" title="编译和发布"></a>编译和发布</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure>

<h2 id="启动本地预览"><a href="#启动本地预览" class="headerlink" title="启动本地预览"></a>启动本地预览</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>
        
      
    </div>

    

    

  </article>

    
  </section>

  
  <nav class="pagination">
    
    
      <a class="next" href="/blog/page/2/">
        <span class="next-text">Next</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>


          </div>
          

        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:your@email.com" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a target="_blank" rel="noopener" href="https://github.com/ahonn" class="iconfont icon-github" title="github"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
    
    
      
      <a href="/blog/atom.xml" class="iconfont icon-rss" title="rss"></a>
    
  </div>


<div class="copyright">
  <span class="power-by">
    Powered by <a class="hexo-link" target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Theme - 
    <a class="theme-link" target="_blank" rel="noopener" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">
    
    &copy; 
     
      2015 - 
    
    2021

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Lucas</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    


    
  



  
  





  
    <script type="text/javascript" src="/blog/lib/jquery/jquery.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/fancybox/jquery.fancybox.pack.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/pjax/jquery.pjax.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/nprogress/nprogress.min.js"></script>
  


    <script type="text/javascript" src="/blog/js/src/even.js?v=2.9.0"></script>

  </body>
</html>
